<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-editors-options-text.qdoc -->
  <title>Specifying Text Editor Settings | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Specifying Text Editor Settings</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-editor-options.html" />
  <link rel="next" href="creator-editor-fakevim.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-editor-options.html">Configuring the Editor</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-editor-fakevim.html">Using FakeVim Mode</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level2"><a href="#configuring-fonts">Configuring Fonts</a></li>
<li class="level2"><a href="#defining-color-schemes">Defining Color Schemes</a></li>
<li class="level2"><a href="#file-encoding">File Encoding</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Specifying Text Editor Settings</h1>
<span class="subtitle"></span>
<!-- $$$creator-editor-options-text.html-description -->
<div class="descr"> <a name="details"></a>
<p>Set the font preferences and apply color schemes for syntax highlighting in <b>Tools &gt; Options &gt; Text Editor &gt; Font &amp; Colors</b>.</p>
<p class="centerAlign"><img src="images/qtcreator-font-colors.png" alt="&quot;Text editor options&quot;" /></p><a name="configuring-fonts"></a>
<h3 id="configuring-fonts">Configuring Fonts</h3>
<p>You can select the font family and size. You can specify a zoom setting in percentage for viewing the text. You can also zoom in or out by pressing <b>Ctrl++</b> or <b>Ctrl+-</b>, or by pressing <b>Ctrl</b> and rolling the mouse button up or down. To disable the mouse wheel function, select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Text Editor</b> &gt; <b>Behavior</b> and deselect the <b>Enable scroll wheel zooming</b> check box.</p>
<p>Antialiasing is used by default to make text look smoother and more readable on the screen. Deselect the <b>Antialias</b> check box to turn off antialiasing.</p>
<a name="defining-color-schemes"></a>
<h3 id="defining-color-schemes">Defining Color Schemes</h3>
<p>You can select one of the predefined color schemes for syntax highlighting or create customized color schemes. The color schemes apply to highlighting both C++ and QML files and generic files.</p>
<p>To create a color scheme:</p>
<ol class="1" type="1"><li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Text Editor</b> &gt; <b>Fonts &amp; Color</b> &gt; <b>Copy</b>.</li>
<li>Enter a name for the color scheme and click <b>OK</b>.</li>
<li>In the <b>Foreground</b> field, specify the color of the selected code element.</li>
<li>In the <b>Background</b> field, select the background color for the code element.<p>The backgound of the <b>Text</b> element determines the background of the code editor.</p>
</li>
</ol>
<p>When you copy code from Qt Creator, it is copied in both plain text and HTML format. The latter makes sure that syntax highlighting is preserved when pasting to a rich-text editor.</p>
<a name="file-encoding"></a>
<h3 id="file-encoding">File Encoding</h3>
<p>To define the default file encoding, select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Text Editor</b> &gt; <b>Behavior</b>, and then select a suitable option in <b>Default encoding</b>.</p>
<p>Qt 5 requires UTF-8 encoded source files, and therefore the default encoding was changed from <b>System</b> to <b>UTF-8</b> in Qt Creator version 2.6&#x2e; However, the <b>Default encoding</b> field still displays the value <b>System</b> if the default system encoding is set to UTF-8.</p>
<p>Detecting the correct encoding is tricky, so Qt Creator will not try to do so. Instead, it displays the following error message when you try to edit a file that is not UTF-8 encoded: <b>Error: Could not decode &quot;filename&quot; with &quot;UTF-8&quot;-encoding. Editing not possible.</b></p>
<p>To resolve the issue, use a file conversion tool such as <a href="http://recode.progiciels-bpi.ca/index.html">Recode</a> to convert the file encoding to UTF-8 when developing Qt 5 applications. Otherwise, conversion of string constants to QStrings might not work as expected.</p>
<p>If you develop only Qt 4 applications or other than Qt applications, you can set other encoding options as the default encoding. Select the <b>System</b> option to use the file encoding used by your system.</p>
</div>
<!-- @@@creator-editor-options-text.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-editor-options.html">Configuring the Editor</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-editor-fakevim.html">Using FakeVim Mode</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
